package com.sau.pixelcart.service;

import com.sau.pixelcart.common.result.PageResult;
import com.sau.pixelcart.domain.dto.OrderDTO;
import com.sau.pixelcart.domain.dto.OrderPageDTO;
import com.sau.pixelcart.domain.dto.SalesAnalysisDTO;
import com.sau.pixelcart.domain.entity.Orders;
import com.baomidou.mybatisplus.extension.service.IService;
import com.sau.pixelcart.domain.vo.OrderVO;
import com.sau.pixelcart.domain.vo.SalesAnalysisVO;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

/**
 * <p>
 * 订单核心信息（日均百万级数据需考虑分表） 服务类
 * </p>
 *
 * @author Inton
 * @since 2025-03-27
 */
public interface IOrdersService extends IService<Orders> {

    /**
     * 订单分页查询
     * @param orderPageDTO
     * @return
     */
    PageResult<OrderVO> pageQuery(OrderPageDTO orderPageDTO);

    /**
     * 创建订单
     *
     * @param orderDTO
     */
    void saveOrder(OrderDTO orderDTO);

    /**
     * 销售分析
     * @param salesAnalysisDTO
     * @return
     */
    SalesAnalysisVO saleAnalysis(SalesAnalysisDTO salesAnalysisDTO);

    /**
     * 导出订单报表
     * @param response
     */
    void exportOrders(HttpServletResponse response) throws IOException;

    /**
     * 处理待支付订单
     * @param orderDTO
     */
    void solveNoPayOrder(OrderDTO orderDTO);

    /**
     * 处理超市未支付订单
     * @return
     */
    int batchCancelUnpaidOrders();
}
